class CreateResourceCategories < ActiveRecord::Migration
  def self.up
    create_table :resource_categories do |t|
      t.column :name, :string
    end
    
    document = ResourceCategory::DOCUMENT
    image = ResourceCategory::IMAGE
    video = ResourceCategory::VIDEO
    link = ResourceCategory::LINK
    ResourceCategory.create(:id => document[:id], :name => document[:name])
    ResourceCategory.create(:id => image[:id], :name => image[:name])
    ResourceCategory.create(:id => video[:id], :name => video[:name])
    ResourceCategory.create(:id => link[:id], :name => link[:name])
  end

  def self.down
    drop_table :resource_categories
  end
end